﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Coder.Workflow.ViewModel
{
    public class WorkProcessViewData
    {
        public WorkProcessViewData(WorkProcess process)
        {
            if (process == null) throw new ArgumentNullException(nameof(process));
            Id = process.Id;
            Name = process.Name;
            WorkflowType = process.WorkflowType;

            Items = from task in process.Items select new WorkTaskViewData(task);
        }

        public string WorkflowType { get; set; }
        public int Id { get; set; }
        public string Name { get; set; }

        public IEnumerable<WorkTaskViewData> Items { get; set; }
    }
}